package com.cloud.async.retry;

import java.util.ArrayList;
import java.util.List;

public class DefaultRetryPolicy implements RetryPolicy{

    private static final List<Long> DEFAULT_BACK_DELAY = new ArrayList<>(3);

    static {
        DEFAULT_BACK_DELAY.add(100L);
        DEFAULT_BACK_DELAY.add(100L);
        DEFAULT_BACK_DELAY.add(100L);
    }

    @Override
    public int getMaxAttempts() {
        return 3;
    }

    @Override
    public List<Long> getBackoffDelay() {
        return DEFAULT_BACK_DELAY;
    }
}
